package server;
import java.io.*;
import java.util.LinkedList;

public class scoreBoard implements Serializable {
	
	String action = "scoreBoard";
	
	class scoreEntry{
		public scoreEntry(int x, String n) {
			this.score = x;
			this.name = n;
		}
		int score = 0;
		String name = null;
	}
	
	LinkedList<scoreEntry> board = new LinkedList<scoreEntry>();

	public scoreBoard(){}
	
    private static volatile scoreBoard instance = null;
    
    public static scoreBoard getInstance() {
        if (instance == null){
            synchronized (scoreBoard.class){
                    if (instance == null){
                        instance = new scoreBoard();
                    }
            }
        }
        return instance;
    }
	
	public void addEntry(String name, int x){
		scoreEntry temp = new scoreEntry(x,name);
		this.board.add(temp);
	}
	
	public void resetScores(){
		this.board.clear();
	}
}
